var SearchModel = function () {
  BaseModel.call(this);
  var self = this;

  var fn = {
    initData: function () {
      self.deptWorkshop = [];
      self.propertyList = ['deptWorkshop'];
      self.saveObject();
    }
  };

  this.saveObject = function () {
    this.setOldData(this.propertyList);
  };

  this.resetObject = function () {
    var propertyList = this.propertyList;
    for (var i = 0; i < propertyList.length; i++) {
      var property = propertyList[i];
      var value = this.getOldData(property);
      this[property] = value;
    }
  };

  this.getObject = function () {
    var deptWorkshop = this.deptWorkshop;
    var dept = deptWorkshop[0];
    if (dept === undefined) {
      dept = '';
    }
    var workshop = deptWorkshop[1];
    if (workshop === undefined) {
      workshop = '';
    }

    var obj = {};
    if (dept === '' && workshop === '') {
      return null;
    } else {
      if (dept !== '') {
        obj.deptId = dept;
      }
      if (workshop !== '') {
        obj.workShopId = workshop;
      }
    }
    return obj;
  };

  fn.initData();
};